package com.zzz.robot201.mvp.ui.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.PopupMenu;
import android.widget.TextView;

import com.zzz.robot201.R;
import com.zzz.robot201.mvp.model.api.bean.PopuBean;

import java.util.List;

public class PopuAdapter extends BaseAdapter {
    private Context mContext;
    private List<PopuBean.DataBean> personList;

    public PopuAdapter(List<PopuBean.DataBean> personList, Context mContext) {
        this.personList = personList;
        this.mContext = mContext;
    }

    @Override
    public int getCount() {
        return personList.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    /**
     * 使用打气筒
     */
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        PopuBean.DataBean popBean = personList.get(position);
        View view = View.inflate(mContext, R.layout.item_popu, null);
        //在view里面查找
        TextView idTextView = (TextView) view.findViewById(R.id.tv_pop);
        //一定要是String类型
        idTextView.setText(popBean.getTypeName());

        return view;
    }
}
